package com.travelbid.admin.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class CreateUserForm extends ActionForm {
	private String username;
	private String pwd;
	private String pwdck;
	private String nickname;
	private String question;
	private String selfquestion;
	private String answer;
	private String contactPerson;
	private String telphone;
	private String email;
	private String type;
	private Integer unitid;
	private String inner_catvalue[] = new String[0];
	private String outer_catvalue[] = new String[0];
	private String checkran;
	private String code;
	private String address;
	private String fax;
	private String sex;
	private String companyName;
	private String companyAddress;
	private String msn;
	private String qq;

	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCompanyAddress() {
		return companyAddress;
	}

	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public CreateUserForm() {
		super();

	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getSelfquestion() {
		return selfquestion;
	}

	public void setSelfquestion(String selfquestion) {
		this.selfquestion = selfquestion;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public String[] getInner_catvalue() {
		return inner_catvalue;
	}

	public void setInner_catvalue(String[] inner_catvalue) {
		this.inner_catvalue = inner_catvalue;
	}

	public String[] getOuter_catvalue() {
		return outer_catvalue;
	}

	public void setOuter_catvalue(String[] outer_catvalue) {
		this.outer_catvalue = outer_catvalue;
	}

	public Integer getUnitid() {
		return unitid;
	}

	public void setUnitid(Integer unitid) {
		this.unitid = unitid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getContactPerson() {
		return contactPerson;
	}

	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPwdck() {
		return pwdck;
	}

	public void setPwdck(String pwdck) {
		this.pwdck = pwdck;
	}

	public String getCheckran() {
		return checkran;
	}

	public void setCheckran(String checkran) {
		this.checkran = checkran;
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		String check = (String) request.getSession().getAttribute("check");
		System.out.println("check:" + check);
		if ((checkran != null) && (check != null)) {
			if (!checkran.toLowerCase().equals(check.toLowerCase())) {
				errors.add("checkerror", new ActionMessage("(验证码不正确!)", false));
			}
		}
		return errors;
	}

	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.username = "";
		this.pwd = "";
		this.pwdck = "";
		this.nickname = "";
		this.contactPerson = "";
		this.telphone = "";
		this.email = "";
		this.inner_catvalue = new String[0];
		this.outer_catvalue = new String[0];
		this.fax = "";
		this.sex = "";
		this.msn = "";
		this.qq = "";
		this.companyName = "";
		this.companyAddress = "";

	}
}
